﻿using System;
using System.Collections.Generic;
using Sustainalytics.ClientDW.Entities;
using Sustainalytics.Utils;

namespace Sustainalytics.CompanyReportSyncStep.HistoricalData
{

    public class HistoricalDataComputationContext
    {
        public Guid CompanyId { get; private set; }
        public DateTime ProcessingDate { get; private set; }
        public string CapitalIQID { get; private set; }

        public HistoricalDataComputationContext(Guid companyId, DateTime processingDate, string capitalIQID)
        {
             if (companyId==default(Guid))
                throw new Exception("Invalid Guid");

            if (capitalIQID.IsNullOrEmpty())
            {
                throw new ArgumentNullException("capitalIQID");
            }

            if (processingDate == default(DateTime))
            {
                throw new Exception("Invalid date");
            }

            CompanyId = companyId;
            ProcessingDate = processingDate;
            CapitalIQID = capitalIQID;
        }
    }
    public interface IHistoricalDataManager
    {
        void SetComputationContext(Guid companyId,string capitalIQID,DateTime? date=null);

        bool ShouldUpdate();
        bool SaveHistoricalData();

        void SetIndicatiors(IEnumerable<RpIndicatorCommon> indicators);
        CompanyHistoryData GetCompanyHistoryData();
        void SetHistoricalCompanyData();

    }
}